package org.example.mapper;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.*;
import org.example.pojo.DApartment;
import org.example.pojo.DStaff;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.example.pojo.select.*;
import org.example.pojo.statis.StaffTrend;
import org.example.utils.Result;

import java.time.LocalDate;
import java.util.List;
import java.util.Map;

/**
* @author chenhongkai
* @description 针对表【d_staff】的数据库操作Mapper
* @createDate 2024-03-11 10:20:48
* @Entity org.example.pojo.DStaff
*/
public interface DStaffMapper extends BaseMapper<DStaff> {
    static void staffBak(DStaff staffBak) {
    }
//    @Select("select * from d_staff where apartment_id = #{apartment_id}" )
//    public List<DStaff> SelectAllStaffs_byApartmentId(int apartment_id);

//    @Select("select * from d_staff")
//    @Results({
//            @Result(column = "staff_id",property = "staffId"),
//            @Result(column = "apartment_id",property = "apartmentId"),
//            @Result(column = "staff_phoneNumber",property = "staffPhonenumber"),
//            @Result(column = "check_in_date",property = "checkInDate"),
//            @Result(column = "staff_type",property = "staffType"),
//            @Result(column = "staff_name",property = "staffName"),
//            @Result(
//                    column = "apartment_id",property = "apartment",
//                    javaType = DApartment.class,
//                    one = @One(select = "org.example.mapper.DApartmentMapper.SelectApartment_byApartmentId")
//            )
//    })

    public Integer SelectPendingStaffsTotal(@Param("pendingStaffSelect") PendingStaffSelect pendingStaffSelect);
    public List<DStaff> SelectPendingStaff(@Param("pendingStaffSelect") PendingStaffSelect pendingStaffSelect);

    Long SelectAllStaffs_total(@Param("dStaffSelect") DStaffSelect dStaffSelect);
    public IPage<DStaff> SelectAllStaffs(Page<DStaff> page, @Param("dStaffSelect") DStaffSelect dStaffSelect);

    public int updateApartment(DStaff dStaff);

    public DStaff selectApartmentByStaffId(String staffId);

    DStaff selectByName(DStaff dStaff);

    public List<DStaff> selectStaffByApartmentId(String apartmentId);

    DStaff selectStaffPhoneNumber(Integer sid);

    DStaff select_staff_amount_byStaffId(String staffId,String amountDate);

    DStaff selectByStaffId(String staffId);

    List<String> selectStaffByApartmentId_array(String apartmentId);

    Integer SelectResignStaffTotal(@Param("resignStaffSelect") ResignStaffSelect resignStaffSelect);

    IPage<Map> SelectResignStaff(Page<DStaff> page,@Param("resignStaffSelect") ResignStaffSelect resignStaffSelect);

    int DeleteResignStaff(@Param("dStaff") DStaff dStaff);

    int UpdateStaffStatus(@Param("dStaff") DStaff dStaff);

    List<DStaff> selectStaffByOther(@Param("dApartmentSelect") DApartmentSelect dApartmentSelect);

    int DeleteStaff(Integer sid);

    Integer insertStaff(DStaff dStaff);
    int insertStaffB(DStaff dStaffB);

    Integer SelectExceptionStaffTotal(@Param("exceptionStaffSelect") ExceptionStaffSelect exceptionStaffSelect);

    IPage<Map> SelectExceptionStaff(Page<DStaff> page,@Param("exceptionStaffSelect") ExceptionStaffSelect exceptionStaffSelect);

    List<DStaff> SelectAllDownStaffs();

    DStaff selectEmpByStaffId(String staffId);

    void DeleteStaffBySid(@Param("dStaff") DStaff dStaff);

    Integer getWeekCheckIn(@Param("firstDayOfWeek")String firstDayOfWeek, @Param("lastDayOfWeek")String lastDayOfWeek);

    Integer getWeekCheckOut(@Param("firstDayOfWeek")String firstDayOfWeek, @Param("lastDayOfWeek")String lastDayOfWeek);

    Integer getWeekStaffNumber(@Param("lastDayOfWeek") String lastDayOfWeek);

    List<DStaff> SelectStaffInfo(@Param("dStaffSelect") DStaffSelect dStaffSelect);



//    List<StaffTrend> getWeekCheckIns();
//    List<StaffTrend> getWeekCheckOuts();
//    List<StaffTrend> getWeek();


//    void insertStaffBak(@Param("staffBak") DStaff staffBak,@Param("operationType") String operationType);
}




